package cn.hwadee.muying.recommend;

/**
 * @创建人 skiner
 * @创建时间 2018/8/14
 * @描述
 */
public class Node implements Comparable<Node> {


    private long id;
    private double score;

    public Node() {
    }

    public Node(long id) {
        this.id = id;
    }

    public Node(long id, double score) {
        this.id = id;
        this.score = score;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Node{" +
                "id=" + id +
                ", score=" + score +
                '}';
    }

    /**
     *
     * @param o
     * @return
     */
    @Override
    public int compareTo(Node o) {
        double t = this.score-o.score;
        return t>0?1:(t==0)?0:-1;
    }
}